home *** CD-ROM | disk | FTP | other *** search
/ Risc World 9 / Risc World 9.iso / Software / Issue1 / Wolf3D.ZIP / Extras / Tech Info / ASWAP Info next >
Text File  |  1994-07-09  |  2KB  |  75 lines

  1. Archimedes Wolfenstein-3D
  2.  
  3. ASWAP File Format Specification
  4.  
  5. (c) 1994 Powerslave Software
  6.  
  7. Written by Eddie Edwards 16/06/94
  8.  
  9. This document describes the format used by the ASWAP file in the Powerslave
  10. Software conversion of Wolfenstein 3D.
  11.  
  12. OVERALL STRUCTURE
  13. -----------------
  14.  
  15. The first 4096 bytes contains the directory of the rest of the file.
  16. The next chunk of file contains the wall bitmaps
  17. The next chunk of file contains the object bitmaps (RL-encoded)
  18. The next chunk of file contains the samples
  19.  
  20. DIRECTORY FORMAT
  21. ----------------
  22.  
  23. The first 8 bytes contain global information:
  24.  
  25. Bytes 0/1       - Total number of items in the directory = W + O + S
  26.                   ORd with &8000 to indicate that this is an ASWAP and not
  27.                   a VSWAP file
  28. Bytes 2/3       - Total number of walls = W
  29. Bytes 4/5       - Total number of walls and objects = W + O
  30. Byte 6          - Major format number (currently 0)
  31. Byte 7          - Minor format number (currently 1)
  32.  
  33. Then there are (W+O+S) 4-byte numbers, each of which is a file offset of that
  34. resource.  The last byte of a resource is always the byte before the first
  35. byte of the next resource.  There is a final 4-byte number, which is the length
  36. of the file (or the file offset of the next logical resource).  The rest of
  37. the 4K chunk is reserved and should be set to all binary zeros.
  38.  
  39. The first W offsets point to wall bitmaps.
  40. The next O offsets point to object bitmaps.
  41. The last S offsets point to samples.
  42.  
  43. WALL BITMAPS
  44. ------------
  45.  
  46. These are 4096 bytes each, and consist of raw data (each byte represents one
  47. pixel, with the Mode 13 palette). The bitmaps are stored column by column,
  48. i.e. the pixels are in order (0,0),(0,1)...(0,63),(1,0)...(1,63)...(63,63).
  49.  
  50. OBJECT BITMAPS
  51. --------------
  52.  
  53. These are run-length encoded. The actual data is in Mode 13 format, but it is
  54. encoded as follows:
  55.  
  56. First byte - 0 = end of row
  57.              1-127 = that number of data bytes follow
  58.              128-255 = skip 256-that number of bytes (mask)
  59.  
  60. There are 64 rows (and 64 columns). As an example, the following row:
  61.  
  62.       ....XXXXXXXXX.....AAABBCD....
  63.  
  64. would be stored as:
  65.  
  66. 252 9 X X X X X X X X X 251 7 A A A B B C D 0
  67.  
  68. Only the mask is RL-encoded, the data per scanline is raw.
  69.  
  70. SAMPLES
  71. -------
  72.  
  73. These are in 8-bit logarithmic format, and should be played back at around
  74. 6.5KHz.
  75.